import VueI18n from 'vue-i18n'
import Vue from 'vue'
import elZh from 'element-ui/lib/locale/lang/zh-CN'
import elEn from 'element-ui/lib/locale/lang/en'
import localZh from './zh'
import localEn from './en'
import jsCookie from 'js-cookie'
Vue.use(VueI18n)
const i18n = new VueI18n({
  locale: jsCookie.get('lang') || 'zh', // en:英文，zh:中文
  messages: {
    // 语言包
    en: {
      xxx: 'home',
      ...elEn,
      ...localEn
    },
    zh: {
      xxx: '首页',
      ...elZh,
      ...localZh
    }
  }
})
export default i18n
